{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 22,
   "outputs": [],
   "source": [
    "import os\n",
    "import json\n",
    "import time\n",
    "import datetime\n",
    "from selenium import webdriver\n",
    "from selenium.webdriver.common.by import By\n",
    "from bs4 import BeautifulSoup as bf\n",
    "from tqdm import tqdm\n",
    "import random\n",
    "from paras import *\n",
    "#config parameters domin\n",
    "store_path = GET_PLATFORM()\n",
    "\n",
    "\n",
    "def write_json(file_name,obj_dict,store_dir):\n",
    "\n",
    "    json_str = json.dumps(obj_dict,ensure_ascii=False)\n",
    "    file_obsolute_path = os.path.join(store_dir,file_name)\n",
    "    print(\"file : {} write success!\".format(file_obsolute_path))\n",
    "    with open(file_obsolute_path, 'w' , encoding='utf-8') as json_file:\n",
    "        json_file.write(json_str)\n",
    "\n",
    "def get_browser(url):\n",
    "    browser = webdriver.Chrome()\n",
    "    browser.get(url)\n",
    "    return browser\n",
    "\n",
    "def try_mkdir(store_dir):\n",
    "    try:\n",
    "            os.mkdir(store_dir)\n",
    "    except:\n",
    "        pass\n",
    "\n",
    "def filter_baoliao_url(url):\n",
    "    #url = \"https://www.smzdm.com/p/46908363\"\n",
    "    u_s = url.split(\"/\")\n",
    "    if u_s[2] == \"www.smzdm.com\" and u_s[3] == \"p\" and int(u_s[4]): #filter of baoliao url\n",
    "        return True\n",
    "    else:\n",
    "        return False\n",
    "\n",
    "def culcu_months(date):\n",
    "    if len(date.split(\"-\"))==1:\n",
    "        time_standard = time.strftime(\"%Y-%m-%d\", time.localtime())\n",
    "    if len(date.split(\"-\"))==2:\n",
    "        time_standard_ = time.strftime(\"%Y\", time.localtime())\n",
    "        time_standard  = \"{}-{}\".format(time_standard_,date.split(\" \")[0])\n",
    "    if len(date.split(\"-\"))==3:\n",
    "        time_standard  = date\n",
    "\n",
    "    date_now = time.strftime(\"%Y-%m-%d\", time.localtime())\n",
    "    date_now_list = date_now.split(\"-\")\n",
    "    date_past_list = time_standard.split(\"-\")\n",
    "    data1 = datetime.date(int(date_now_list[0]),int(date_now_list[1]),int(date_now_list[2]))\n",
    "    date2 = datetime.date(int(date_past_list[0]),int(date_past_list[1]),int(date_past_list[2]))\n",
    "    months = int((data1-date2).days/30)\n",
    "    #print(\"now_date : {} , past_date : {} , months : {}\".format(date_now,time_standard,months))\n",
    "    return months\n",
    "\n",
    "def is_limited(browser):\n",
    "    \"\"\"ip limited?\"\"\"\n",
    "    url = browser.current_url\n",
    "    return  url.split(\"/\")[4]==\"limiter_identify\"\n",
    "\n",
    "def enter_baoliao(browser,UGC_sum):\n",
    "    if \"爆料\" in UGC_sum.keys():\n",
    "        button_baoliao = browser.find_element(By.CSS_SELECTOR,\"body > div.container > div.cont-left > ul > li.navtab-title.baoliao > a\")\n",
    "        button_baoliao.click()\n",
    "\n",
    "def enter_comment(browser,UGC_sum):\n",
    "    if \"评论\" in UGC_sum.keys():\n",
    "        button_comment = browser.find_element(By.CSS_SELECTOR,\"body > div.container > div.cont-left > ul.navtab > li.navtab-title.comment > a\")\n",
    "        button_comment.click()\n",
    "\n",
    "def get_browser_lite(url):\n",
    "    options = webdriver.ChromeOptions()\n",
    "    prefs={\n",
    "         'profile.default_content_setting_values': {\n",
    "            #'images': 2,\n",
    "            'javascript':2\n",
    "        }\n",
    "    }\n",
    "    options.add_experimental_option('prefs',prefs)\n",
    "\n",
    "    browser = webdriver.Chrome(chrome_options=options)\n",
    "    browser.get(url)\n",
    "    return browser\n",
    "\n",
    "def try_select_element(doc_model,css_selector):\n",
    "    try:\n",
    "        result = doc_model.select(css_selector)[0]\n",
    "    except:\n",
    "        return None\n",
    "    return result\n",
    "\n",
    "def try_select_elements(doc_model,css_selector):\n",
    "    try:\n",
    "        result = doc_model.select(css_selector)\n",
    "    except:\n",
    "        return None\n",
    "    return result\n",
    "\n",
    "def strip_str(str):\n",
    "    return  str.replace('\\n', '').replace('\\r', '').replace(' ', '')\n",
    "\n",
    "def get_pages_user(sum):\n",
    "    per_page_comments=10\n",
    "    pages=sum//per_page_comments+1\n",
    "    return pages\n",
    "\n",
    "def turn_page_user(browser,page_num):\n",
    "    input_button = browser.find_element( By.CSS_SELECTOR , \"#beginpage\")\n",
    "    input_button.click()\n",
    "    input_button.clear()\n",
    "    input_button.send_keys(page_num)\n",
    "    Go_button = browser.find_element(By.CSS_SELECTOR , \"body > div.container > div.cont-left > ul.pagination > li:last-child > a\")\n",
    "    Go_button.click()\n",
    "\n",
    "def crawl_single_page_baoliao(browser,baoliao_dict,page_index,baoliao_url_list):\n",
    "    html = browser.page_source\n",
    "    doc_model = bf(html,'html.parser')\n",
    "    baoliao_list = doc_model.select(\"body > div.container > div.cont-left > div > div.pandect-content-stuff\")\n",
    "    index = 1\n",
    "    for baoliao in baoliao_list:\n",
    "        url = baoliao.select(\"div.pandect-content-title > a\")[0][\"href\"]\n",
    "        baoliao_title = strip_str(baoliao.select(\"div.pandect-content-title > a\")[0].text)\n",
    "        baoliao_detail = strip_str(baoliao.select(\"div.pandect-content-detail\")[0].text)\n",
    "        baoliao_type_a = baoliao.select(\"div.pandect-content-type > a\")\n",
    "        baoliao_type = \"\"\n",
    "        if baoliao_type_a:\n",
    "            baoliao_type = baoliao_type_a[0].text\n",
    "        baoliao_time = baoliao.select(\"div.pandect-content-type > span\")[0].text\n",
    "\n",
    "        result = {\n",
    "            \"title\":baoliao_title,\n",
    "            \"detail\":baoliao_detail,\n",
    "            \"type\":baoliao_type,\n",
    "            \"baoliao_time\":baoliao_time,\n",
    "            \"url\":url\n",
    "        }\n",
    "\n",
    "        baoliao_dict[\"baoliao\"+str(index+page_index*10)] = result\n",
    "        baoliao_url_list.append(url)\n",
    "        index = index+1\n",
    "\n",
    "    return baoliao_dict,baoliao_url_list,baoliao_time\n",
    "\n",
    "def crawl_baoliao(browser,UGC_sum):\n",
    "    enter_baoliao(browser,UGC_sum)\n",
    "    baoliao_sum = int(UGC_sum[\"爆料\"])\n",
    "    baoliao_pages = get_pages_user(baoliao_sum)\n",
    "    print(\"baoliao pages ： %d \"%(baoliao_pages))\n",
    "    baoliao_dict = {}\n",
    "    baoliao_url_list = []\n",
    "    for page_index in tqdm(range(baoliao_pages)):\n",
    "        if page_index == 0:\n",
    "            baoliao_dict,baoliao_url_list,baoliao_time = crawl_single_page_baoliao(browser,baoliao_dict,page_index,baoliao_url_list)\n",
    "            if culcu_months(baoliao_time) >= MONTHS_RANGE:#crawl half year data\n",
    "               break\n",
    "        else:\n",
    "            time.sleep(random.randint(1, 4))\n",
    "            turn_page_user(browser,page_index+1)\n",
    "            baoliao_dict,baoliao_url_list,baoliao_time =crawl_single_page_baoliao(browser,baoliao_dict,page_index,baoliao_url_list)\n",
    "            if culcu_months(baoliao_time) >= MONTHS_RANGE:#crawl half year data\n",
    "               break\n",
    "    return baoliao_dict,list(set(baoliao_url_list))\n",
    "\n",
    "def crawl_single_page_comment(browser,comment_dict,page_index,comment_refer_item_list):\n",
    "    html = browser.page_source\n",
    "    doc_model = bf(html,'html.parser')\n",
    "    comment_list = doc_model.select(\"body > div.container > div.cont-left > div[id^=div_comment]\")\n",
    "    index = 1\n",
    "    for comment in comment_list:\n",
    "        com = strip_str(comment.select(\"div.centerBlock > div.infoNews\")[0].text)\n",
    "        date = comment.select(\"div.rightBlock > span\")[0].text\n",
    "        url = comment.select(\"div.centerBlock > div.objectBlock > span.objTitle > a\")[0][\"href\"]\n",
    "        abstract = strip_str(comment.select(\"div.centerBlock > div.objectBlock > span.objTitle > a\")[0].text)\n",
    "        result = {\n",
    "            \"comment\":com,\n",
    "            \"abstract\":abstract,\n",
    "            \"data\":date,\n",
    "            \"url\":url\n",
    "        }\n",
    "\n",
    "        comment_dict[\"comment\"+str(index+page_index*10)] = result\n",
    "\n",
    "        if filter_baoliao_url(url):\n",
    "            comment_refer_item_list.append(url)\n",
    "\n",
    "        index = index+1\n",
    "\n",
    "    return comment_dict,comment_refer_item_list,date\n",
    "\n",
    "def crawl_comment(browser,UGC_sum):\n",
    "    enter_comment(browser,UGC_sum)\n",
    "    comment_sum = int(UGC_sum[\"评论\"])\n",
    "    comment_pages = get_pages_user(comment_sum)\n",
    "    print(\"comment pages ： %d \" % (comment_pages))\n",
    "    comment_dict = {}\n",
    "    comment_refer_item_list = []\n",
    "\n",
    "    for page_index in tqdm(range(comment_pages)):\n",
    "        if page_index == 0:\n",
    "            comment_dict,comment_refer_item_list,date = crawl_single_page_comment(browser,comment_dict,page_index,comment_refer_item_list)\n",
    "            if culcu_months(date)>=MONTHS_RANGE:#crawl half year data\n",
    "               break\n",
    "        else:\n",
    "            time.sleep(random.randint(1,4))\n",
    "            turn_page_user(browser,page_index+1)\n",
    "            comment_dict,comment_refer_item_list,date = crawl_single_page_comment(browser,comment_dict,page_index,comment_refer_item_list)\n",
    "            if culcu_months(date)>=MONTHS_RANGE:#crawl half year data\n",
    "               break\n",
    "\n",
    "    return comment_dict,list(set(comment_refer_item_list))\n",
    "\n",
    "def get_user_info(browser,url,user_type):\n",
    "\n",
    "\n",
    "    html = browser.page_source\n",
    "    doc_model = bf(html,'html.parser')\n",
    "\n",
    "    crawl_time = time.strftime(\"%Y-%m-%d %H:%M:%S\", time.localtime())\n",
    "    user_id = url.split(\"/\")[-2]\n",
    "    user_profile_url = 'https:'+try_select_element(doc_model,\"body > div.container > div.cont-left > div.self-info.other-person-page > div.face-stuff > div > div > img\")[\"src\"]\n",
    "    user_focus = int(try_select_element(doc_model,\"body > div.container > div.cont-right > div.user-info > a.user-focus > span\").text)\n",
    "    user_fans = int(try_select_element(doc_model,\"body > div.container > div.cont-right > div.user-info > a.user-fans > span\").text)\n",
    "    user_name = try_select_element(doc_model,\"body > div.container > div.cont-left > div.self-info.other-person-page > div.info-stuff > div.info-stuff-set > span.info-stuff-nickname > a\").text\n",
    "    user_level = int(try_select_element(doc_model,\"body > div.container > div.cont-left > div.self-info.other-person-page > div.info-stuff > div.info-stuff-set > div.rank.face-stuff-level > a > img\")[\"src\"].split(\"/\")[-1][0])\n",
    "    user_medal = try_select_element(doc_model,\"body > div.container > div.cont-left > div.self-info.other-person-page > div.info-stuff > div.info-stuff-set > div.icon-medal > a > img\")[\"alt\"]\n",
    "    signature = strip_str(try_select_element(doc_model,\"body > div.container > div.cont-left > div.self-info.other-person-page > div.info-stuff > div.info-stuff-words\").text)\n",
    "    icon_info = try_select_elements(doc_model,\"body > div.container > div.cont-left > div.self-info.other-person-page > div.info-stuff > div.bottom-words\")\n",
    "    icon_info_dict = {}\n",
    "    for tag in icon_info:\n",
    "        icon_info_dict[tag.i[\"class\"][0]] = tag.text\n",
    "    navtabs = try_select_elements(doc_model,\"body > div.container > div.cont-left > ul > li:not(:first-child)\")\n",
    "    UGC_sum = {}\n",
    "    if navtabs:\n",
    "        for tab in navtabs:\n",
    "            a=tab.text.split()\n",
    "            UGC_sum[a[0]]=int(a[1])\n",
    "\n",
    "    if user_type == \"commen_user\":\n",
    "        #baoliao , baoliao_url_list = crawl_baoliao(browser, UGC_sum)\n",
    "        baoliao = {}\n",
    "        comment_dict,comment_refer_item_list = crawl_comment(browser,UGC_sum)\n",
    "\n",
    "        graph_structure_user = {\n",
    "            \"user_url\": url,\n",
    "            \"user_type\":user_type,\n",
    "            \"comment_refer_item\": comment_refer_item_list\n",
    "        }\n",
    "\n",
    "    if user_type == \"creator\":\n",
    "        baoliao , baoliao_url_list= crawl_baoliao(browser,UGC_sum)\n",
    "        #comment_dict,comment_refer_item_list = crawl_comment(browser,UGC_sum)\n",
    "        comment_dict = {}\n",
    "\n",
    "        graph_structure_user = {\n",
    "            \"user_url\": url,\n",
    "            \"user_type\": user_type,\n",
    "            \"baoliao_url_list\":baoliao_url_list,\n",
    "        }\n",
    "\n",
    "\n",
    "    user_info = {\n",
    "\n",
    "        \"url\":url,\n",
    "        \"crawl_time\":crawl_time,\n",
    "        \"user_id\":user_id,\n",
    "        \"user_name\":user_name,\n",
    "        \"profile_url\":user_profile_url,\n",
    "        \"focus\":user_focus,\n",
    "        \"fans\":user_fans,\n",
    "        \"member_level\":user_level,\n",
    "        \"medal\":user_medal,\n",
    "        \"signature\":signature,\n",
    "        \"icon_info\":icon_info_dict,\n",
    "        \"UGC\":UGC_sum,\n",
    "        \"baoliao\":baoliao,\n",
    "        \"comment\":comment_dict\n",
    "\n",
    "    }\n",
    "\n",
    "    return user_info,graph_structure_user\n",
    "\n",
    "# def crawl_user_commen(url):\n",
    "#     try:\n",
    "#         user_info, graph_structure_user = get_user_info(url, \"commen_user\")\n",
    "#         filename_user_info = \"user_{}.json\".format(url.split(\"/\")[-2])\n",
    "#         file_name_graph = \"user_{}_graph_structure.json\".format(url.split(\"/\")[-2])\n",
    "#         write_json(filename_user_info, user_info)\n",
    "#         write_json(file_name_graph, graph_structure_user)\n",
    "#         return True\n",
    "#     except:\n",
    "#         return False\n",
    "\n",
    "def try_close_browser(browser):\n",
    "    try:\n",
    "        browser.close()\n",
    "    except:\n",
    "        pass\n",
    "\n",
    "def crawl_user_commen(url):\n",
    "    try:\n",
    "        browser = get_browser(url)\n",
    "        user_info, graph_structure_user = get_user_info(browser,url, \"commen_user\")\n",
    "        store_dir = os.path.join(store_path,\"user_{}\".format(url.split(\"/\")[-2]))\n",
    "        try_mkdir(store_dir)\n",
    "        comment_refer_items = graph_structure_user[\"comment_refer_item\"]\n",
    "        filename_user_info = \"user_{}.json\".format(url.split(\"/\")[-2])\n",
    "        file_name_graph = \"user_{}_graph_structure.json\".format(url.split(\"/\")[-2])\n",
    "        write_json(filename_user_info, user_info ,store_dir)\n",
    "        write_json(file_name_graph, graph_structure_user,store_dir)\n",
    "        try_close_browser(browser)\n",
    "        return True , comment_refer_items #url list\n",
    "\n",
    "    except Exception as log :\n",
    "        try_close_browser(browser)\n",
    "        return False , log\n",
    "\n",
    "\n",
    "def crawl_user_creator(url):\n",
    "    try:\n",
    "        browser = get_browser(url)\n",
    "        user_info, graph_structure_user = get_user_info(browser,url, \"creator\")\n",
    "        store_dir = os.path.join(store_path,\"creator_{}\".format(url.split(\"/\")[-2]))\n",
    "        try_mkdir(store_dir)\n",
    "        baoliao_url_list = graph_structure_user[\"baoliao_url_list\"]\n",
    "        filename_user_info = \"user_{}.json\".format(url.split(\"/\")[-2])\n",
    "        file_name_graph = \"user_{}_graph_structure.json\".format(url.split(\"/\")[-2])\n",
    "        write_json(filename_user_info, user_info ,store_dir)\n",
    "        write_json(file_name_graph, graph_structure_user,store_dir)\n",
    "        try_close_browser(browser)\n",
    "        return True , baoliao_url_list\n",
    "\n",
    "    except Exception as log :\n",
    "        try_close_browser(browser)\n",
    "        return False , log"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "comment pages ： 272 \n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  8%|▊         | 22/272 [01:36<18:19,  4.40s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "file : /Users/leslie/Desktop/smzdm/user_8434265629/user_8434265629.json write success!\n",
      "file : /Users/leslie/Desktop/smzdm/user_8434265629/user_8434265629_graph_structure.json write success!\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "#STATE , items_list = crawl_user_creator(\"https://zhiyou.smzdm.com/member/2910179216/\")\n",
    "STATE , items_list  = crawl_user_commen(\"https://zhiyou.smzdm.com/member/8434265629/\")"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "outputs": [
    {
     "data": {
      "text/plain": "['https://www.smzdm.com/p/49136401',\n 'https://www.smzdm.com/p/47607182',\n 'https://www.smzdm.com/p/45496779',\n 'https://www.smzdm.com/p/39792692',\n 'https://www.smzdm.com/p/39128269',\n 'https://www.smzdm.com/p/49345038',\n 'https://www.smzdm.com/p/49353053',\n 'https://www.smzdm.com/p/45571321',\n 'https://www.smzdm.com/p/48789452',\n 'https://www.smzdm.com/p/48354498',\n 'https://www.smzdm.com/p/43531782',\n 'https://www.smzdm.com/p/48693300',\n 'https://www.smzdm.com/p/47581459',\n 'https://www.smzdm.com/p/43432020',\n 'https://www.smzdm.com/p/46414833',\n 'https://www.smzdm.com/p/49319237',\n 'https://www.smzdm.com/p/44848762',\n 'https://www.smzdm.com/p/45918581',\n 'https://www.smzdm.com/p/45173930',\n 'https://www.smzdm.com/p/45627505',\n 'https://www.smzdm.com/p/44467113',\n 'https://www.smzdm.com/p/45583071',\n 'https://www.smzdm.com/p/48476098',\n 'https://www.smzdm.com/p/46277507',\n 'https://www.smzdm.com/p/45556039',\n 'https://www.smzdm.com/p/46990589',\n 'https://www.smzdm.com/p/39038085',\n 'https://www.smzdm.com/p/44569731',\n 'https://www.smzdm.com/p/47523165',\n 'https://www.smzdm.com/p/46772191',\n 'https://www.smzdm.com/p/39105767',\n 'https://www.smzdm.com/p/44577146',\n 'https://www.smzdm.com/p/43765923',\n 'https://www.smzdm.com/p/44578030',\n 'https://www.smzdm.com/p/45410640',\n 'https://www.smzdm.com/p/49637048',\n 'https://www.smzdm.com/p/44948665',\n 'https://www.smzdm.com/p/46142549',\n 'https://www.smzdm.com/p/39581024',\n 'https://www.smzdm.com/p/48376412',\n 'https://www.smzdm.com/p/48926848',\n 'https://www.smzdm.com/p/48334050',\n 'https://www.smzdm.com/p/42949984',\n 'https://www.smzdm.com/p/45640128',\n 'https://www.smzdm.com/p/44779118',\n 'https://www.smzdm.com/p/46712572',\n 'https://www.smzdm.com/p/44414981',\n 'https://www.smzdm.com/p/47566049',\n 'https://www.smzdm.com/p/40306427',\n 'https://www.smzdm.com/p/47775242',\n 'https://www.smzdm.com/p/44899764',\n 'https://www.smzdm.com/p/45193747',\n 'https://www.smzdm.com/p/46067335',\n 'https://www.smzdm.com/p/47040582',\n 'https://www.smzdm.com/p/43868627',\n 'https://www.smzdm.com/p/47189452',\n 'https://www.smzdm.com/p/46863336',\n 'https://www.smzdm.com/p/45426393',\n 'https://www.smzdm.com/p/45745244',\n 'https://www.smzdm.com/p/46298369',\n 'https://www.smzdm.com/p/44445251',\n 'https://www.smzdm.com/p/49152064',\n 'https://www.smzdm.com/p/46573676',\n 'https://www.smzdm.com/p/42623665',\n 'https://www.smzdm.com/p/46407736',\n 'https://www.smzdm.com/p/48801776',\n 'https://www.smzdm.com/p/43481437',\n 'https://www.smzdm.com/p/46880498',\n 'https://www.smzdm.com/p/46041134',\n 'https://www.smzdm.com/p/45719563',\n 'https://www.smzdm.com/p/44277682',\n 'https://www.smzdm.com/p/37016819',\n 'https://www.smzdm.com/p/49723715',\n 'https://www.smzdm.com/p/49523601',\n 'https://www.smzdm.com/p/43083935',\n 'https://www.smzdm.com/p/48676640',\n 'https://www.smzdm.com/p/44298157',\n 'https://www.smzdm.com/p/45900399',\n 'https://www.smzdm.com/p/43224708',\n 'https://www.smzdm.com/p/47163751',\n 'https://www.smzdm.com/p/43664387',\n 'https://www.smzdm.com/p/42975877',\n 'https://www.smzdm.com/p/47298446',\n 'https://www.smzdm.com/p/39170111',\n 'https://www.smzdm.com/p/44244514',\n 'https://www.smzdm.com/p/45971692',\n 'https://www.smzdm.com/p/46669401',\n 'https://www.smzdm.com/p/48237321',\n 'https://www.smzdm.com/p/44339249',\n 'https://www.smzdm.com/p/49037425',\n 'https://www.smzdm.com/p/44889363',\n 'https://www.smzdm.com/p/43220541',\n 'https://www.smzdm.com/p/45106661',\n 'https://www.smzdm.com/p/46547556',\n 'https://www.smzdm.com/p/46559795',\n 'https://www.smzdm.com/p/46674701',\n 'https://www.smzdm.com/p/42975249',\n 'https://www.smzdm.com/p/38698965',\n 'https://www.smzdm.com/p/46908363',\n 'https://www.smzdm.com/p/39320416',\n 'https://www.smzdm.com/p/40275705',\n 'https://www.smzdm.com/p/45069343',\n 'https://www.smzdm.com/p/43182142',\n 'https://www.smzdm.com/p/44073000',\n 'https://www.smzdm.com/p/45714179',\n 'https://www.smzdm.com/p/49619291',\n 'https://www.smzdm.com/p/46520189',\n 'https://www.smzdm.com/p/38964736',\n 'https://www.smzdm.com/p/39323459',\n 'https://www.smzdm.com/p/38957875',\n 'https://www.smzdm.com/p/49600952',\n 'https://www.smzdm.com/p/43742302',\n 'https://www.smzdm.com/p/43798350',\n 'https://www.smzdm.com/p/39054648',\n 'https://www.smzdm.com/p/47245601',\n 'https://www.smzdm.com/p/39175134',\n 'https://www.smzdm.com/p/43447700',\n 'https://www.smzdm.com/p/45353513',\n 'https://www.smzdm.com/p/44410974',\n 'https://www.smzdm.com/p/41122531',\n 'https://www.smzdm.com/p/43430682',\n 'https://www.smzdm.com/p/44151496',\n 'https://www.smzdm.com/p/43441124']"
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "items_list"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "name": "pycharm-69f4e5e5",
   "language": "python",
   "display_name": "PyCharm (local)"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}